package data_bases.beans;

import data_bases.business.CreatingSquemaBusiness;
import java.io.Serializable;
import java.sql.Connection;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import login.beans.ConectionBean;

/**
 *
 * @author JuanFelipe
 */
@ManagedBean
@ViewScoped
public class CreatingSquemaBean implements Serializable{
    private String name;
    private String collation;
    private static final long serialVersionUID = 2L;
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCollation() {
        return collation;
    }

    public void setCollation(String collation) {
        this.collation = collation;
    }
    //Metodo no soportado, esta en construccion
    public void createSquema( Connection conn ){
        Connection cconnection = conn;
        //String user;
        CreatingSquemaBusiness csb 
                = new CreatingSquemaBusiness(cconnection, name, collation /*username*/ );
        
        try{
            csb.create();
        }catch ( Exception e){
            System.out.println("EX: "+e);
        }
    }
}
